package com.timschimandle.getitdone;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

public class PeopleFragment extends Fragment {
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		
		View v = inflater.inflate(R.layout.person_item, container,false);
		Bundle bundle = this.getArguments();
		
		if (bundle != null) {
			
			Person p = (Person) bundle.getSerializable("selected_person");
			
			EditText etf = (EditText) v.findViewById(R.id.first_name);
			etf.setText(p.getFirstName());
			
			EditText etl = (EditText) v.findViewById(R.id.last_name);
			etl.setText(p.getLastName());
			
			EditText ete = (EditText) v.findViewById(R.id.email);
			ete.setText(p.getEmail());
			
			EditText etp = (EditText) v.findViewById(R.id.phone_number);
			etp.setText(p.getPhoneNumber());
			
		}
		
		return v;
	}
}
